---
title: PdfCacheRequest
summary: API reference for PdfCacheRequest.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-09-17
library: PdfAPI.Core
reference_type: package
---

# PdfCacheRequest

`PdfCacheRequest` is the request contract for reading a cached PDF by its source id. It is a contract only — PdfAPI.Core performs no cache I/O; consumers honour `CacheType` and `Id` against their own cache store.

## Purpose
- Carries the source id, PDF/A flag, and target `CacheType` needed to look up a cached PDF.
- Exposes a computed validity flag (`IsValid`) that gates whether a lookup should proceed. ([BR-43](../../business-rules.md#br-43-cache-request-validity))

## Context
- Namespace: `PdfAPI.Core.Cache`
- Assembly/package: `PdfAPI.Core`

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| RequestId | `Guid RequestId { get; }` | A new `Guid` generated per request instance, identifying this specific lookup. |
| PdfCacheRequest(long, bool, CacheType) | `PdfCacheRequest(long id, bool pdfa = false, CacheType cacheType = Image)` | Constructs a cache request for the given source id, PDF/A flag, and cache type. |
| CacheType | `CacheType CacheType { get; set; }` | The cache store to query. |
| Id | `long Id { get; set; }` | The source id of the PDF to look up. |
| Pdfa | `bool Pdfa { get; set; }` | Whether the cached PDF should be the PDF/A variant. |
| IsValid | `bool IsValid => Id > 0` | `true` only when `Id` is a positive value. ([BR-43](../../business-rules.md#br-43-cache-request-validity)) |

## Behavioral notes
- `IsValid` treats any non-positive `Id` (zero or negative) as an invalid request, with no other field contributing to validity. ([BR-43](../../business-rules.md#br-43-cache-request-validity))

## Constraints and usage notes
- Check `IsValid` before issuing a cache lookup with a caller-supplied `Id`.

## Related documentation
- [Index](../../index.md)
- [Overview](../../overview.md)
- [Architecture](../../architecture.md)
- [Dependencies](../../dependencies.md)
- [Operations and processes](../../operations-processes.md)
- [Business rules](../../business-rules.md)
- [Security and authorization](../../security-authorization.md)
- [API reference](../index.md)

## Sources
- `PdfAPI.Core\Cache\PdfCacheRequest.cs`
